From 55e1e76bac62630c3de3117cf350815b4c26318c Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Wed, 19 Jan 2005 14:03:33 +0000 Subject: [PATCH] bitkeeper revision 1.1159.223.5 (41ee68b5s7SXOX6FRHT9GQ92WWOtRA) Truncate the e820 RAM map to 4GB maximum on 32-bit x86. We don't support PAE36 mode. --- xen/arch/x86/e820.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c index 63bc128c7e..50f1b5fc8b 100644 --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -309,8 +309,33 @@ static void __init machine_specific_memory_setup( struct e820entry *raw, int raw_nr) { char nr = (char)raw_nr; + int i; + sanitize_e820_map(raw, &nr); + (void)copy_e820_map(raw, nr); + +#ifdef __i386__ + /* 32-bit systems restricted to a 4GB physical memory map. */ + for ( i = 0; i < e820.nr_map; i++ ) + { + if ( (e820.map[i].addr + e820.map[i].size) <= 0x100000000ULL ) + continue; + printk("WARNING: Only the first 4GB of the physical memory map " + "can be accessed\n" + " by Xen in 32-bit mode. " + "Truncating the memory map...\n"); + if ( e820.map[i].addr >= 0x100000000ULL ) + { + e820.nr_map = i; + } + else + { + e820.map[i].size = 0x100000000ULL - e820.map[i].addr; + e820.nr_map = i + 1; + } + } +#endif } unsigned long init_e820(struct e820entry *raw, int raw_nr) -- 2.30.2